<!--{if use_local_comment}-->
<div class="comment-fixed fixed-bottom">
    <div class="panel-comm panel-default">
        <div class="panel-body">
            <div class="fr">
                <!--{if $access && $enable_post}-->
                <a href="javascript:;" data-name="post_comment"><span class="label-comm label-mycolor label-big">发表评论</span></a>
                <!--{elseif !$enable_post}-->
                <span class="txt-grey">评论已关闭</span>
                <!--{elseif !$user->isLogin}-->
                <a href="{url member/mobile/do/login}"><span class="label-comm label-mycolor label-big">登录</span></a>
                <a href="{url member/mobile/do/reg}"><span class="label-comm label-mycolor label-big">注册</span></a>
                <!--{/if}-->
            </div>
            <!--{eval $p=$idtype.'_'.$id;}-->
            <a href="{url comment/mobile/do/list/p/$p}">{if $comments}共有 {$comments} 条评论{else}暂无评论{/if}</a>
        </div>
    </div>
</div>
<!--{if $access && $enable_post}-->
<div id="comment_form" class="none">
    {include mobile_template('comment_post')}
</div>
<!--{/if}-->
<script>
var drawer = null;
$(document).ready(function() {
    $(document.body).css("margin-bottom",$('div.comment-fixed').height()+5);
    $('a[data-name="post_comment"]').click(function() {
        if(!drawer) drawer = new $.m_drawer('#frm_comment_box', {type:'float-bottom'},{
            onInit:function(obj, workArea) {
                workArea.find('[data-name="seccode"]').m_seccode();
            },
            onOpen:function(obj, workArea) {
                if(!obj.is_first_open) {
                    workArea.find('[data-name="seccode"] > img').click();
                }
            }
        });
        drawer.open();
    });
});
</script>
<!--{/if}-->